import yaml,time,yagmail
import logging
# 时间戳
t=time.strftime("%Y%m%d-%H%M%S",time.localtime())
def qudong(file):
    with open(file,'r',encoding='utf-8') as f:
        return yaml.safe_load(f)
def log():
    logging.basicConfig(filename=f'{t}.log',
                        level=logging.DEBUG,
                        filemode='a+',
                        format='%(filename)s' '%(levelname)s' '%(message)s' '%(asctime)s' '%(lineno)d'
                        )
def youjian(file):
    mail=yagmail.SMTP(user='2018675435@qq.com',password='nnqakcckuzyqfebd',host='smtp.qq.com')
    mail.send(to='2018675435@qq.com',subject='a3mall自动化测试',contents='UI自动化测试脚本',attachments=file)
